package com.syni.mdd.sjb.common.datatreaure.controller.protect.dataTreasure.client;

import com.syni.mdd.sjb.common.component.utils.common.annotations.CheckUserIdentity;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rq.BaseRqVo;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rq.dataBankClient.ChangeUserGroupRqVo;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rq.dataBankClient.ClientDataRqVo;
import com.syni.mdd.sjb.common.datatreaure.service.databank.DataBankClientService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


@RestController
@RequestMapping("/databank/client")
@Log4j2
public class BankClientController {

    @Autowired
    DataBankClientService dataBankClientService;
    @PostMapping("/getAllClientDataOfficial")
    @ApiOperation(value = "客户数据—全部")
    @CheckUserIdentity
    public Map<String,Object> getAllClientData(@RequestBody ClientDataRqVo clientDataRqVo){
        return dataBankClientService.getAllClientData(clientDataRqVo);
    }

    @PostMapping("/getAllClientData")
    @ApiOperation(value = "客户数据—全部（正式）")
    @CheckUserIdentity
    public Map<String,Object> getAllClientDataOfficial(@RequestBody ClientDataRqVo clientDataRqVo){
        return dataBankClientService.getAllClientDataOfficial(clientDataRqVo);
    }

    @PostMapping("/getTypicalDataOfficial")
    @ApiOperation(value = "客户数据—典型人群")
    @CheckUserIdentity
    public Map<String,Object> getTypicalData(@RequestBody ClientDataRqVo clientDataRqVo) {
        return dataBankClientService.getTypicalData(clientDataRqVo);
    }

    @PostMapping("/getTypicalData")
    @ApiOperation(value = "客户数据—典型人群(正式)")
    @CheckUserIdentity
    public Map<String,Object> getTypicalDataOfficial(@RequestBody ClientDataRqVo clientDataRqVo){
        return dataBankClientService.getTypicalDataOfficial(clientDataRqVo);
    }

    @PostMapping("/getUserGroup")
    @ApiOperation(value = "获取用户分群")
    @CheckUserIdentity
    public Map<String,Object> getUserGroup(@RequestBody BaseRqVo baseRqVo){
        return dataBankClientService.getUserGroup(baseRqVo);
    }

    @PostMapping("/changeUserGroup")
    @ApiOperation(value = "修改用户分群选择")
    @CheckUserIdentity
    public Map<String,Object> changeUserGroup(@RequestBody ChangeUserGroupRqVo changeUserGroupRqVo){
        return dataBankClientService.changeUserGroup(changeUserGroupRqVo);
    }
}
